#!/usr/bin/env python3

filename = "test.txt"
exit_key = ["exit", "q", "Q"]
active = True

with open(filename, "w") as file:
    while active:
        name = input("what's your name?\n")
        if name in exit_key:
            break
        print(f"hi, {name}")
        name += "\n"
        file.write(name)
